package com.qf.test;

/**
 * @author zdl
 * @date 2025/1/11
 */
public class Animal {
    String name;
   private int age;

    public Animal() {
    }

    public Animal(String name) {
        this.name = name;
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println("吃饭");
    }

    public void eat(String name) {
        System.out.println(name + "吃饭");
    }

    public void eat(String name, int age) {
        System.out.println(name + "吃饭" + age + "岁了");
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
